<?php

// register our sidebar for widgets
if ( function_exists('register_sidebar') )
{
	register_sidebar(array('before_widget' => '<div class="right">','after_widget' => '</div></div>','before_title' => '<div class="rightTitle">','after_title' => '</div><div class="rightWidget">',));
}

function print_post( $meta=false )
{
?>
			<div <?php post_class() ?> id="post-<?php the_ID(); ?>">
				<h2 class="posttitle"><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2>
				<?php the_content(); ?>
				<p class="postmetadata"><?php the_tags('tags: ', ', ', '<br />'); ?> posted in <?php the_category(', ') ?> | <?php edit_post_link('Edit', '', ' | '); ?>  <?php comments_popup_link('no comments &#187;', '1 comment &#187;', '% Comments &#187;'); ?></p>
                <?php if( $meta ) { print_meta(); } ?>
			</div>
<?php
}

function print_meta()
{
?>
				<p class="postmetadata alt">
					<small>
						<b>posted:</b> <?php the_time('l, F jS, Y') ?> @ <?php the_time() ?><br />
                        <b>categories:</b> <?php the_category(', ') ?><br />
                        <b>comments feed:</b> <?php post_comments_feed_link('RSS 2.0'); ?>
                    </small>
                </p>
                    
				<p class="postmetadata alt">

						<?php if (('open' == $post-> comment_status) && ('open' == $post->ping_status)) {
							// Both Comments and Pings are open ?>
							You can <a href="#respond">leave a response</a>, or <a href="<?php trackback_url(); ?>" rel="trackback">trackback</a> from your own site.

						<?php } elseif (!('open' == $post-> comment_status) && ('open' == $post->ping_status)) {
							// Only Pings are Open ?>
							Responses are currently closed, but you can <a href="<?php trackback_url(); ?> " rel="trackback">trackback</a> from your own site.

						<?php } elseif (('open' == $post-> comment_status) && !('open' == $post->ping_status)) {
							// Comments are open, Pings are not ?>
							You can skip to the end and leave a response. Pinging is currently not allowed.

						<?php } elseif (!('open' == $post-> comment_status) && !('open' == $post->ping_status)) {
							// Neither Comments, nor Pings are open ?>
							Both comments and pings are currently closed.

						<?php } edit_post_link('Edit this entry','','.'); ?>
				</p>
<?php
}

function print_page()
{
?>
			<div class="page" id="post-<?php the_ID(); ?>">
				<!-- <p class="pagetitle"><?php the_title(); ?></p> -->
                <?php print_title( the_title('','',false) ); ?>
				<?php the_content(); ?>
				<?php wp_link_pages(array('before' => '<p><strong>Pages:</strong> ', 'after' => '</p>', 'next_or_number' => 'number')); ?>
			</div>
<?php
}

function print_title( $title )
{
	if( file_exists( implode( "/", explode( "/", $_SERVER['SCRIPT_FILENAME'], -1 ) )."/wp-content/themes/filingcabinet_blog/images/FileTabPageTitle.swf" ) ) { ?>
				<div id="flashPageTitle">&nbsp;</div>
				<script type="text/javascript">
                    // <![CDATA[
                        var so = new SWFObject("<?php bloginfo('stylesheet_directory'); ?>/images/FileTabPageTitle.swf", "FileTabPageTitle", "550", "29", "9", "#FFFFFF");
                        so.addParam("wmode", "transparent");
                        so.addVariable("title", "<?php echo $title; ?>");
                        so.write("flashPageTitle");
                    // ]]>
                </script>
<?php
	} else { ?>
		<h2 class="posttitle"><?php echo $title; ?></h2>
	<?php }
}

?>